/**
  * Author: Mei
  * Date: 2020-10-16 13:47
  * Description: 
  *
  */
#include <iostream>

using namespace std;

class Student {
protected:
    int num;
    string name;
public:
    Student(int num, string name) : num(num), name(name) {}

    virtual void display();
};

void Student::display() {
    cout << "Student" << endl;
    cout << "num: " << num << ", name: " << name << endl;
}

class Graduate : public Student {
private:
    int age;
    char sex;
public:
    Graduate(int num, string name, int age, char sex) : Student(num, name), age(age), sex(sex) {}

    void display();
};

void Graduate::display() {
    cout << "Student" << endl;
    cout << "num: " << num << ", name: " << name << ", age: " << age << ", sex: " << sex << endl;
}

int main() {
    Student *s;
    Graduate g(1001, "zhang", 12, 'F');
    s = &g;
    s->display();

    return 0;
}